export const schema = {
    type: "page",
    title: "进行中的项目",
    toolbar: {
        type: "button",
        actionType: "link",
        icon: "fa fa-plus pull-left",
        level: "success",
        label: "新建项目",
        visibleOn: 'acl.can("project:create")',
        link: "/project/create"
    },
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "进行中",
                    to: "/project/my/processing",
                    active: true
                },

                {
                    label: "待审核",
                    to: "/project/my/pending",
                    visibleOn: 'acl.can("project:pending")'
                },

                {
                    label: "待提交",
                    to: "/project/my/draft"
                },


                {
                    label: "已结项",
                    to: "/project/my/outdated"
                }
            ]
        },
        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                type: "crud",
                showHeader: false,
                api: "/api/project/processing",
                panelClassName: "no-border no-shadow bg-white",
                footable: {
                    expand: "all"
                },
                columns: [
                    {
                        name: "name",
                        label: "项目名称",
                        innerClassName: "inline",
                        type: "tpl",
                        tpl: "<a data-link='/project/view/${id}'>${name}</a>"
                    },

                    // {
                    //     type: "image",
                    //     name: "photo",
                    //     label: "项目图片",
                    //     multiple: true,
                    //     imageWrapClassName: 'thumb-md m-b-xs m-r-xs',
                    //     popOver: {
                    //         title: "",
                    //         body:
                    //         '<div class="w-xx-xxl"><% data.photo && data.photo.split(",").map(function(src) { %><img class="w-full m-b-sm" src="<%= src %>" /><% }) %></div>'
                    //     }
                    // },
                    {
                        label: "发起日期",
                        name: "created_at",
                        type: "tpl",
                        tpl: "${created_at|date:LL:YYYY-MM-DD HH:mm:ss}"
                    },
                    {
                        label: "报名截止日期",
                        name: 'join_end',
                        type: 'date'
                    },

                    {
                        label: "已报名 / 已录用 ／ 计划招募人数",
                        type: 'tpl',
                        tpl: "${apply_count} / ${join_people_count} / ${people_count}"
                    },

                    {
                        label: "操作",
                        type: "operation",
                        buttons: [
                            {
                                type: "button",
                                level: "success",
                                label: "修改",
                                visibleOn: 'acl.can("project:verify")',
                                size: "xs",
                                actionType: "link",
                                link: '/project/edit/${id}'
                            }
                        ]
                    },

                    {
                        label: "",
                        type: "operation",
                        innerClassName: "clear btn-toolbar",
                        breakpoint: true,
                        buttons: [
                            {
                                type: "button",
                                label: "志愿时长管理",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/work/${id}"
                            },
                            {
                                type: "button",
                                label: "签到码",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/checkin/${id}"
                            },
                            {
                                type: "button",
                                label: "录用管理",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/project/hire/${id}"
                            },
                            {
                                type: "button",
                                label: "购买保险",
                                level: "info",
                                size: "sm",
                                className: "pull-right",
                                actionType: "link",
                                link: "/safe_plan/buy/${id}"
                            }
                        ]
                    }
                ]
            }
        }
    ]
};
